<!DOCTYPE html>
<html>
<head>
	<title>新闻</title>
	<link href="/libs/css/bootstrap.min.css" rel="stylesheet">
	<link href="/libs/css/sweetalert.min.css" rel="stylesheet">
	<link href="/libs/css/element.min.css" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="/css/public.css">
	<script src="/libs/js/jquery.min.js"></script>
	<script src="/libs/js/bootstrap.min.js"></script>
	<script src="/libs/js/vue.min.js"></script>
	<script src="/libs/js/element.min.js"></script>
	<script src="/libs/js/sweetalert.min.js"></script>
	<style type="text/css">
		[v-cloak] {
		display: none;
		} 
	</style>
</head>
<body>
<div id="app" v-cloak style="padding-bottom: 140px;">

	<nav class="navbar navbar-default" role="navigation">
		<div class="container-fluid">
		<div class="navbar-header">
			<a class="navbar-brand" href="">新闻网</a>
		</div>
		<div>
			<ul class="nav navbar-nav" style="float:right;">
				<li v-if="userMsg.isLogin == false"><a style="cursor: pointer;" :href="'/register.html?jump='+window.location.pathname+window.location.search">注册</a></li>
				<li v-if="userMsg.isLogin == false"><a style="cursor: pointer;" :href="'/login.html?jump='+window.location.pathname+window.location.search">登录</a></li>
				<li v-if="userMsg.isLogin == true" class="dropdown">
					<a href="#" class="dropdown-toggle" data-toggle="dropdown">
						{{userMsg.name||userMsg.account}}
						<b class="caret"></b>
					</a>
					<ul class="dropdown-menu" style="left:auto;right:0;min-width:100px">
						<li style="height:40px;"><a href="/message.html" style="line-height: 40px">个人信息</a></li>
						<li v-on:click="logout" style="height:40px;"><a href="#" style="line-height: 40px">退出登录</a></li>
					</ul>
				</li>
			</ul>
		</div>
		</div>
	</nav>

	<div class="subnav">
		<li v-for="module in moduleList"><a :href="'/classify.html?module='+module.id">{{module.name}}</a></li>
	</div>

	<div class="index-container">
		<h1 style="display: block;width: 800px;margin: 0 auto;border-bottom: 1px solid #dbdbdb;padding-bottom: 10px;margin-bottom: 20px;">热点新闻</h1>
		<div class="index-hot">
			<el-carousel indicator-position="outside">
				<el-carousel-item v-for="key in 4" :key="key" v-if="key-1 < newsList.length" >
					<div class="hot-container">
						<img class="img-responsive" :src="newsList[key-1].coverimg">
						<p class="hot-title"><a :href="'/news.html?id='+newsList[key-1].id" target="_blank">{{newsList[key-1].title}}</a></p>
						<!-- <p class="hot-title">{{key}}</p> -->
					</div>
				</el-carousel-item>
			</el-carousel>
		</div>
		<div class="index-hot-2">
			<div class="title" v-for="n in newsList2.length"><a :href="'/news.html?id='+newsList2[n-1].id" target="_blank">{{newsList[n-1].title}}</a></div>

		</div>
		<div class="module-container">
			<div class="module" v-for="module in moduleList">
				<h3 class="module-title">{{module.name}}<a :href="'/classify.html?module='+module.id" target="_blank">更多{{module.name}}新闻>></a></h3>
				<div class="module-list">
					<div class="module-content" v-for="news in newsList" v-if="news.module_id == module.id"><a target="_blank"  :href="'/news.html?id='+news.id">{{news.title}}</a></div>
				</div>
			</div>
		</div>
	</div>

</div>



<script type="text/javascript" src="/js/index.js"></script>
</body>
</html>